package com.web;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.web.util.LockUtil;

public class ExclusiveLockTest {
	private static ApplicationContext ctx;

	static {
		ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
	}// LockUtil.addChildWatcher("/LockService");
	public static void main(String[] args) {
		try {
			LockUtil.init("192.168.1.101:2181");
			LockUtil.getExclusiveLock();
		} catch (Exception e1) {
			e1.printStackTrace();
		}

		String[] names = ctx.getBeanDefinitionNames();
		for (String s : names) {
			System.out.println(s);
		}
	}
}
